<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:cc="http://java.sun.com/jsf/composite">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="bill" />
        <cc:attribute name="dup" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>

        <h:panelGroup>
            <h:outputStylesheet library="css" name="pharmacypos.css"></h:outputStylesheet>

            <h:panelGroup id="panelAddedBillPrint">
                <div class="fiveinchbill" >

                    <p:panel rendered="#{sessionController.loggedPreference.opdPosBillWithoutLogo eq false}">
<!--                        <div class="institutionName">
                            <h:graphicImage library="image" name="#{sessionController.loggedPreference.logoName}"  style="width: 7cm; margin: auto; "></h:graphicImage>                        
                        </div>-->
                    </p:panel>

                    
                    <p:spacer height="15"/>

                    <div class="headingBill" style="text-align: center; font-weight: bold; font-size: 15px!important;">
                        <h:outputLabel value="Invoice"  style="font-size: 15px!important" />    
                        <h:outputLabel value="**Duplicate**"  rendered="#{cc.attrs.dup eq true}" /> 
                        <h:outputLabel value="**Cancelled**"  rendered="#{cc.attrs.bill.cancelled eq true}" /> 
                    </div>


                    <div class="billline">
                        <h:outputLabel value="--------------------------" style="font-size: 15px!important"></h:outputLabel>
                    </div>
                    <p:spacer height="30"/>


                    <table >


                        <td>
                            <td>


                                <table >
                                     <tr>
                                        <td>
                                            <b>
<!--                                                <h:outputLabel value="Number" style="font-size: 15px!important"></h:outputLabel>-->
                                            </b>
                                        </td>
                                        <td>
                                            <p:spacer width="60" ></p:spacer>
                                        </td>
                                        <td>
<!--                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <b>
                                                <ui:repeat value="#{cc.attrs.bill.billItems}" var="cbi" >
                                                    <h:outputLabel value="#{cbi.billSession.serialNo}" style="font-size: 22px!important; margin-left: 300px!important;"></h:outputLabel>
                                                </ui:repeat>
                                            </b>
                                        </td>

                                    </tr>

                                              <tr>
                                        <td>
                                            <b>
<!--                                                <h:outputLabel value="Consultant" style="font-size: 15px!important"></h:outputLabel>-->
                                            </b>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
<!--                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <b>
                                                <ui:repeat value="#{cc.attrs.bill.billItems}" var="cbi" >
                                                    <h:outputLabel value="#{cbi.billSession.staff.person.nameWithTitle}" style="font-size: 18px!important"></h:outputLabel>
                                                </ui:repeat>
                                            </b>
                                        </td>

                                    </tr>

                                    <tr>
                                        <td>
<!--                                            <h:outputLabel value="Name" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
<!--                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <h:outputLabel value="#{cc.attrs.bill.patient.person.nameWithTitle}" style="font-size: 15px!important"></h:outputLabel>
                                        </td>

                                    </tr>

<!--                                    <tr>
                                        <td>
                                            <h:outputLabel value="Phone" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>
                                            <h:outputLabel value="#{cc.attrs.bill.patient.person.phone}" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                    </tr> -->

                                   
                                    <tr>
                                        <td>
                                            <b>
<!--                                                <h:outputLabel value="App. Date" style="font-size: 15px!important"></h:outputLabel>-->
                                            </b>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
<!--                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <b>
                                                <h:outputLabel value="#{cc.attrs.bill.singleBillSession.sessionDate}" style="font-size: 15px!important">
                                                    <f:convertDateTime pattern="dd MMMM yyyy" ></f:convertDateTime>
                                                </h:outputLabel>
                                            </b>
                                        </td>

                                    </tr>
  
                                    <tr>
                                        <td>
<!--                                            <h:outputLabel value="Time" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
<!--                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <h:outputLabel value="#{cc.attrs.bill.singleBillSession.serviceSession.startingTime}" style="font-size: 15px!important">
                                                <f:convertDateTime pattern="hh:mm a"></f:convertDateTime>
                                            </h:outputLabel>
                                        </td>
                                        <td>
                                        </td>

                                    </tr>



<!--                                    <tr>
                                        <td>
                                            <b>
                                                <h:outputLabel value="Invoice No" style="font-size: 15px!important"></h:outputLabel>
                                            </b>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>
                                            <b>
                                                <h:outputLabel value="#{cc.attrs.bill.paidBill.insId}" style="font-size: 15px!important">
                                                </h:outputLabel>
                                            </b>
                                        </td>

                                    </tr>-->

                                    <ui:repeat value="#{cc.attrs.bill.billFees}" var="cbif" >

                                        <h:panelGroup rendered="#{cbif.feeValue ne 0.0}" >

                                            <tr>
                                                <td>
                                                    <h:outputLabel value="#{cbif.fee.name}" style="font-size: 15px!important"></h:outputLabel>
                                                </td>
                                                <td>
                                                    <p:spacer width="10" ></p:spacer>
                                                </td>
                                                <td>
                                                    <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>
                                                </td>
                                                <td>
                                                    <h:outputLabel value="#{cbif.feeValue}" style="font-size: 15px!important">
                                                        <f:convertNumber pattern="#,##0.00" ></f:convertNumber>
                                                    </h:outputLabel>
                                                </td>

                                            </tr>

                                        </h:panelGroup>


                                    </ui:repeat>



                                    <tr>
                                        <td>
<!--                                            <h:outputLabel value="Total" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
<!--                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>-->
                                        </td>
                                        <td>
                                            <h:outputLabel value="#{cc.attrs.bill.netTotal}" style="font-size: 18px!important">
                                                <f:convertNumber pattern="#,##0.00" ></f:convertNumber>
                                            </h:outputLabel>
                                        </td>

                                    </tr>

<!--                                    <tr>
                                        <td>
                                            <h:outputLabel value="Session Name" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>
                                            <h:outputLabel value="#{cc.attrs.bill.singleBillItem.item.name}" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>

                                        </td>

                                    </tr>

                                    -->
                                    <tr></tr>
                                    <tr></tr>    
<!--                                    
                                    <tr>
                                        <td>
                                            <h:outputLabel value="Doctor No" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
                                            <h:outputLabel value=":" style="font-size: 15px!important"></h:outputLabel>
                                        </td>
                                        <td>
                                            <h:outputLabel value="................." style="font-size: 15px!important"></h:outputLabel>
                                        </td>

                                    </tr>
                                    -->
                                    <tr> </tr>
                                    <tr> </tr>
                                    <tr> </tr>
                                    <tr>
                                        <td>
                                            <h:outputLabel value="Issued By" ></h:outputLabel>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
                                            <h:outputLabel value=":" ></h:outputLabel>
                                        </td>
                                        <td>
                                            <h:outputLabel value="#{cc.attrs.bill.paidBill.creater.webUserPerson.name}"></h:outputLabel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <td>
                                            <p:spacer width="10" ></p:spacer>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <h:outputLabel value=""></h:outputLabel>
                                        </td>
                                    </tr>

                                </table>
                            </td>
                        </td>
                    </table>
                </div>
            </h:panelGroup>


        </h:panelGroup>
    </cc:implementation>
</html>